package com.hcq.controller;

import com.common.entity.GlobalMsg;
import com.common.entity.Rsp;
import com.hcq.service.GlobalMsgServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class GlobalMsgController {

    @Autowired
    private GlobalMsgServiceImpl globalMsgService;

    @PostMapping("/findByUserId")
    public Rsp findByUserId (@RequestBody GlobalMsg globalMsg){
        return globalMsgService.findByUserId(globalMsg);
    }

    @PostMapping("/updateStatus")
    public Rsp updateStatus (@RequestBody GlobalMsg globalMsg){
        return globalMsgService.updateStatus(globalMsg);
    }

    @PostMapping("/addOneMsg")
    public Rsp addOneMsg(@RequestBody GlobalMsg globalMsg){
        return globalMsgService.addOne(globalMsg);
    }
}
